<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="AddBacklogItemsToSprint.aspx.cs" Inherits="AddBacklogItemsToSprint"
    Title="Tackle - Add Backlog Items to Sprint" %>

<%@ MasterType VirtualPath="~/MasterPage.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentHolder" runat="Server">
    <strong>Add Master Backlog Items to Sprint<br />
    </strong><span style="font-size: 8pt">
        <br />
        Check the items below you'd like to add to the sprint.<br />
        <br />
        <asp:UpdatePanel runat="server" ID="UPGridView" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:GridView ID="gvBacklogSelection" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                    CellPadding="4" DataKeyNames="MasterBacklogID" DataSourceID="dsBacklogSelection"
                    Font-Names="Verdana" Font-Size="X-Small" ForeColor="#333333" GridLines="None"
                    OnPreRender="gvBacklogSelection_PreRender">
                    <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                    <Columns>
                        <asp:TemplateField HeaderText="Add to Sprint">
                            <EditItemTemplate>
                                <asp:CheckBox ID="CheckBox1" runat="server" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="CheckBox1" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="MasterBacklogID" HeaderText="MasterBacklogID" InsertVisible="False"
                            ReadOnly="True" SortExpression="MasterBacklogID" Visible="False" />
                        <asp:BoundField DataField="ProductName" HeaderText="Product" SortExpression="ProductName" />
                        <asp:BoundField DataField="Feature" HeaderText="Feature" SortExpression="Feature" />
                        <asp:BoundField DataField="Activity" HeaderText="Activity" SortExpression="Activity" />
                        <asp:TemplateField HeaderText="Description" SortExpression="Description">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Description") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblDescription" runat="server" OnPreRender="lblDescription_PreRender"
                                    Text='<%# Bind("Description") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="MasterRank" HeaderText="Master Rank" SortExpression="MasterRank" />
                        <asp:BoundField DataField="Hours" HeaderText="Hours" SortExpression="Hours" />
                    </Columns>
                    <RowStyle BackColor="#E3EAEB" />
                    <EditRowStyle BackColor="#7C6F57" />
                    <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                    <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                    <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
            </ContentTemplate>
        </asp:UpdatePanel>
        &nbsp;<br />
        <asp:Button ID="btnAddItems" runat="server" Font-Names="Verdana" Font-Size="X-Small"
            OnClick="btnAddItems_Click" Text="Add Selected Items" />
        <asp:Button ID="btnCancel" runat="server" Font-Names="Verdana" Font-Size="X-Small"
            OnClick="btnCancel_Click" Text="Cancel" /><asp:SqlDataSource ID="dsBacklogSelection" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
            OldValuesParameterFormatString="original_{0}" ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
            SelectCommand="SELECT TOP (100) PERCENT tblProducts.ProductName, tblMasterBacklog.Feature, tblMasterBacklog.Activity, tblMasterBacklog.Description, tblMasterBacklog.MasterRank, tblMasterBacklog.Hours, tblMasterBacklog.MasterBacklogID, tblProducts.ProductComplete FROM tblMasterBacklog INNER JOIN tblProducts ON tblMasterBacklog.fProductID = tblProducts.ProductID INNER JOIN tblScrumTeam ON tblProducts.fScrumTeamProductListID = tblScrumTeam.ScrumTeamProductListID LEFT OUTER JOIN (SELECT SprintBacklogID, fSprintID, fMasterBacklogID, Task, TaskOwnerID, BaseTime, ActualTimeTotal, RemainingTimeTotal, PuntedTimeTotal, Notes, OOF, Discovered FROM tblSprintBacklog AS tblSprintBacklog_1 WHERE (fSprintID = @SprintID)) AS tblSprintBacklog ON tblMasterBacklog.MasterBacklogID = tblSprintBacklog.fMasterBacklogID WHERE (tblMasterBacklog.FeatureComplete = 0) AND (tblSprintBacklog.fMasterBacklogID IS NULL) AND (tblScrumTeam.ScrumTeamID = @ScrumTeamID) AND (tblProducts.ProductComplete = 0) ORDER BY tblMasterBacklog.MasterRank">
            <SelectParameters>
                <asp:SessionParameter Name="ScrumTeamID" SessionField="ScrumTeamID" />
                <asp:SessionParameter Name="SprintID" SessionField="ESBSprintID" />
            </SelectParameters>
        </asp:SqlDataSource>
    </span>
</asp:Content>
